
/// <reference path="../declare.d.ts"/>

declare module "html5sortable" {
    let sortable: (selector: HTMLElement | string, options?: any) => {};
    export = sortable;
}

type RequireConfig = {
    context: string,
    baseUrl?: string
};

type RequireContext = {
    config: RequireConfig
}

declare let requirejs: {
    (config: RequireConfig, modules: string[], callback?: Function, err?: Function);
    (modules: string[], callback?: Function, err?: Function);
    config: Function;
    exec(name);
};

declare module "js-md5" {
    let md5: {
        (text: string): string;
    };
    export = md5;
}

declare class ClipboardJS {
    constructor(selector: string | HTMLElement, options: {
        text: () => string
    });

    on(event: string, callback: (e: any) => void);
}

declare enum QRErrorCorrectLevel {
    L,
    M,
    Q,
    H
}
declare class QRCode {
    constructor(element: HTMLElement, text: string);
    constructor(element: HTMLElement, options?: {
        text: string,
        width: number,
        height: number,
        typeNumber?: number,
        colorDark?: string,
        colorLight?: string,
        correctLevel?: QRErrorCorrectLevel
    });
    clear();
    makeCode(text?: string);
}

// declare module "maishu-jueying" {

// }


declare let WeixinJSBridge: any;

//==========================================================
// js-xlsx
interface Utils {
    aoa_to_sheet(data: Array<Array<any>>): SheetJS;
    book_new(): BookJS;
    book_append_sheet(wb: BookJS, ws: SheetJS, sheet_name: string);
}
interface SheetJS {

}
interface BookJS {
    SheetNames: string[],
    Sheets: SheetJS[]
}

declare namespace XLSX {
    export let utils: Utils;
    function writeFile(wb: BookJS, file_name: string);
}
//==========================================================

declare module "json!websiteConfig" {
    let a: ShopWebsiteConfig & import("maishu-chitu-admin/static").WebsiteConfig;
    export = a;
}

declare module "json!../websiteConfig" {
    let a: ShopWebsiteConfig & import("maishu-chitu-admin/static").WebsiteConfig;
    export = a;
}

declare module "lessc" {
    let lessc: any;
    export = lessc;
}
